/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.techshop.service.impl;

import com.techshop.dao.DistrictDao;
import com.techshop.model.District;
import com.techshop.service.DistrictService;
import java.util.List;

/**
 *
 * @author Hai-PC
 */
public class DistrictServiceImpl implements DistrictService
{    
    private DistrictDao districtDao;    

    @Override
    public District getById(int districtID)
    {
        return this.getDistrictDao().getById(districtID);
    }

    @Override
    public boolean insert(District district)
    {
        return this.getDistrictDao().insert(district);
    }

    @Override
    public boolean update(District district)
    {
        return this.getDistrictDao().update(district);
    }

    @Override
    public boolean delete(District district)
    {
        return this.getDistrictDao().delete(district);
    }

    /**
     * @return the districtDao
     */
    public DistrictDao getDistrictDao()
    {
        return districtDao;
    }

    /**
     * @param districtDao the districtDao to set
     */
    public void setDistrictDao(DistrictDao districtDao)
    {
        this.districtDao = districtDao;
    }

    @Override
    public List<District> getByProvinceId(int provinceId)
    {
        return districtDao.getByProvinceId(provinceId);
    }

    @Override
    public List<District> getAll()
    {
        return districtDao.getAll();
    }
}